package com.unicom.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

//@Controller
@RestController  // 如果每个功能返回的都是Restful内容，那么可以使用该注解
public class SpringController {
	
	@RequestMapping("/hello")
	// 如果内容是Restful内容，不写ResponseBody会进行跳转
//	@ResponseBody
	public String hello(){
		return "hello";
	}
	
	@RequestMapping("/hehe")
//	@ResponseBody
	public String hehe(){
		return "hehe";
	}
	
	
	
	// @PathVariable 把{msg}接收到的参数赋值给 msg
	@RequestMapping("/show/{msg}")
	public String show(@PathVariable String msg){
		return "msg: " + msg + "...";
	}
	
	
	
	
	
	
	
}
